<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title></title>
    <style>
        * {
            padding: 0;
            margin: 0;
        }
        .comment {
            font-size: 40px;
            color: red;
        }
        .comment li {
            float: left;
            cursor: pointer;
        }
        ul {
            list-style: none;
        }
    </style>
</head>
<body>

<ul class="comment">
    <li>☆</li>
    <li>☆</li>
    <li>☆</li>
    <li>☆</li>
    <li>☆</li>
</ul>
<script src="jquery-1.8.2.min.js"></script>
<script>
    $(function () {
        var wjx_none = '☆'; // 空心五角星
        var wjx_sel = '★'; // 实心五角星

        $('.comment li ').on('mouseenter',function () {

            $(this).text(wjx_sel).prevAll('li').text(wjx_sel).end().nextAll('li').text(wjx_none);
        });

        $('.comment li').on('mouseleave',function () {
            if($('li.current').length ===0 ){
                $('.comment li').text(wjx_none);
            }else{

                $('li.current').text(wjx_sel).prevAll('li').text(wjx_sel).end().nextAll('li').text(wjx_none);
            }
        });

        $('li').on('click',function () {
            $(this).attr('class','current').siblings('li').removeAttr('class');
        });
    });
</script>
</body>
</html>